alist = [22,1,15,3,46,75,6,99]
for i in range(0,len(alist)-1):
    for j in range(0,len(alist)-i-1):
        if alist[j] > alist[j+1]:
            alist[j], alist[j+1] = alist[j+1], alist[j]
            # t = alist[j]
            # alist[j] = alist[j+1]
            # alist[j+1] = t
print(alist)
# 找到张三在第几班
classes = [["李四","哑巴","马斯","张帅"],["刘德华","张三","二胖"],["马六","王五","刘子"]]
i = 1
for c in classes:
    # c是班级
    for s in c:
        if s == "张三":
            print("张三在第%d班"%i)
    i += 1
'''
作业：案例三
登录操作：将用户名密码存储到list = ["colin","123456"]中用户名和密码进行录入判断，
当用户名是colin 密码是123456的时候显示登录成功。如果密码和用户名录入错误需要循环录入，并且录入错误次数超过三次提示账户已锁，并且停止循环
'''
list = ['colin','123456']
i = 3
user = input("请输入用户名：")
if user == list[0] :
    while i > 0 :
        password = input("请输入密码：")
        i = i - 1
        if password == list[1] :
            print("登录成功")
            break
        elif i > 0:
            print("密码错误，请重新输入。你还有%d次机会"%i)
        else:
            print("错误次数超过三次，账户锁定")
else :
    print("用户名错误")
